import request from '@/utils/request'

/**
 * @description 获取列表
 */
export function getList(params) {
  const param = {
    sortField: 'orderNum:1'
  }
  param.page = params.page
  param.conditionLst = []
  // 导航名称
  if (typeof params.item.name !== 'undefined' && params.item.name !== '') {
    param.conditionLst.push({
      fieldName: 'name',
      fieldValue: params.item.name,
      operator: 'LK'
    })
  }
  const data = {
    reqType: 'LIST',
    param
  }
  return request({
    url: '/qfNavFunction',
    method: 'post',
    data
  })
}

/**
 * @description 添加保存
 * @param {*} params
 */
export function addSave(params) {
  const data = {
    data: {
      item: params
    },
    reqType: 'ADD'
  }
  return request({
    url: '/qfNavFunction',
    method: 'post',
    data
  })
}

/**
 * @description 编辑保存
 * @param {*} params
 */
export function updateSave(params) {
  const data = {
    data: {
      item: params
    },
    reqType: 'UPDATE'
  }
  return request({
    url: '/qfNavFunction',
    method: 'post',
    data
  })
}

/**
 * @description 删除保存
 * @param {*} params
 */
export function deleteSave(params) {
  const data = {
    data: {
      item: params
    },
    reqType: 'DELETE'
  }
  return request({
    url: '/qfNavFunction',
    method: 'post',
    data
  })
}

export default {
}
